﻿using System;
using UnityEngine;

namespace Z1029.NoteGlobalView
{
    public class NotesManager : MonoBehaviour
    {
        public Note note;

        private void Start()
        {
        }

        public Note InstantiateNote(NoteType type, Note.NoteData data, JudgementLine judgeline, Note.Direction dir)
        {
            GameObject gameObject = Instantiate(note.gameObject);
            Note component = gameObject.GetComponent<Note>();
            component.noteData = data;
            component.direction = dir;
            component.judgeline = judgeline;
            gameObject.transform.parent = judgeline.transform;

            gameObject.name = "Note - " + data.time;

            component.Awake();
            component.Start();

            return component;
        }
    }
}